import request from "./config";

// 获取私信列表
export const getMessageList = (params) => {
  return request({
    url: "/api/messages/conversations",
    method: "get",
    params,
  });
};

export const getChatRecord = (params) => {
  return request({
    url: "/api/messages/chat",
    method: "get",
    params,
  });
};

// 删除私信
export const deleteMessage = (params) => {
  return request({
    url: `/api/messages/delChat`,
    method: "delete",
    params,
  });
};

// 获取私信详情
export const getMessageDetail = (id) => {
  return request({
    url: `/messages/${id}`,
    method: "get",
  });
};

// 发送私信
export const sendMessage = (data) => {
  return request({
    url: "/api/messages/initiate",
    method: "post",
    data,
  });
};
